package com.itheima.user.web;

import com.itheima.user.pojo.User;
import com.itheima.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 29143
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserWeb {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public User findUserById(@PathVariable("id") Long id,@RequestHeader(value = "name",required = false) String name){
        return userService.findUserById(id);
    }
}
